module display(
	input  [7:0] data,
	input  [7:0] ascii,
	input  key,
	output reg [6:0] out1,
	output reg [6:0] out2,
	output reg [6:0] out3,
	output reg [6:0] out4,
	output reg [6:0] out5,
	output reg [6:0] out6
);
	reg [7:0] data_in;
	reg [7:0] ascii_in;
	reg  [7:0] count;

	always @(key) begin
		if(key) begin
			data_in <= data;
			ascii_in <= ascii;
			if(count[3:0] == 9) begin
				count[3:0] <= 0;
				if(count[7:4] == 9) begin
					count[7:4] <= 0;
				end else begin
					count[7:4] <= count[7:4] + 1;
				end
			end else begin
				count[3:0] <= count[3:0] + 1;
			end
		end else begin
			data_in <= 0;
			ascii_in <= 0;
		end
	end

	digitalTube tube1(
		.in(data_in[3:0]),
		.out(out1)
	);

	digitalTube tube2(
		.in(data_in[7:4]),
		.out(out2)
	);

	digitalTube tube3(
	.in(ascii_in[3:0]),
	.out(out3)
	);


	digitalTube tube4(
		.in(ascii_in[7:4]),
		.out(out4)
	);
	
	digitalTube tube5(
		.in(count[3:0]),
		.out(out5)
	);

	digitalTube tube6(
		.in(count[7:4]),
		.out(out6)
	);

endmodule
